from threading import Thread
import time

def say_hello():
    print('hello how are you')
    time.sleep(2)#还是会三个一起打印出来，多线程这是

if __name__ == '__main__':
    # for i in range(3):
    #     t=Thread(target=say_hello)#创建线程，循环 创建了3个
    #     t.start()#启动线程，这里才是真正的创建线程


        # say_hello()#会时隔2秒打印，这是单线程

    t=Thread(target=say_hello)#就创建了一个线程，单线程也是
    t.start()